import {DefaultTheme} from "vitepress";

export function sidebarVue3():DefaultTheme.SidebarItem[] {
  return [
    {
      text: 'Vue3源码',
      items: [
        { text: '设计思想', link: '/design-think' },
      ],
    },
    {
      text: 'Vue3整体架构',
      items: [
        { text: 'Vue3架构介绍', link: '/struct' },
        { text: 'Vue3开发环境搭建', link: '/prodenv' },
      ],
    },
    {
      text: 'Vue3响应式原理',
      collapsed: false,
      items: [
        { text: 'Vue3响应式', link: '/proxy' },
        { text: 'Reactive & Effect', link: '/reactive' },
        { text: 'Ref实现原理', link: '/ref' },
        { text: 'Computed', link: '/computed' },
        { text: 'Watch & WatchEffect', link: '/watch' },
      ],
    },
    {
      text: 'Vue3渲染原理',
      items: [
        { text: 'Vue3自定义渲染器', link: '/render' },
        { text: 'Runtime DOM', link: '/runtime-dom' },
        { text: 'Runtime Core', link: '/runtime-core' },
      ],
    },
    {
      text: 'Vue3 Diff算法',
      items: [
        { text: 'Diff流程', link: '/diff' },
      ],
    },
    {
      text: '组件渲染原理',
      collapsed: false,
      items: [
        { text: 'text、Fragment渲染', link: '/text' },
        { text: '组件渲染', link: '/component' },
        { text: 'setup函数', link: '/setup' },
        { text: '函数式组件实现原理', link: '/functional' },
        { text: 'Provide/Inject原理', link: '/provide-inject' },
        { text: 'Ref实现原理', link: '/ref-principle' },
      ],
    },
    {
      text: '其他实现原理',
      collapsed: false,
      items: [
        { text: 'Teleport实现原理', link: '/teleport' },
        { text: 'Transition组件', link: '/transition' },
        { text: 'Keep-Alive实现原理', link: '/keep-alive' },
        { text: '异步组件实现原理', link: '/sync-com' },
      ],
    },
    {
      text: '模板编译原理',
      collapsed: false,
      items: [
        { text: '编译优化', link: '/compile' },
        { text: '模板转化AST语法树', link: '/ast' },
        { text: '代码转化', link: '/code-tran' },
        { text: '代码生成', link: '/code-prd' },
      ],
    },
  ]
}